﻿/**
 * http://www.kahrel.plus.com/indesign/scriptui-1-5.pdf
 */

#include "scriput-ui.jsx"



(function(){
    
    var myWindow = new Window("dialog", "Comment Form", undefined, {"resizeable":true} );

    var sample_data = {
        "type": "panel",
        "child": {
            "exporter-label": {
                "type": "statictext",
                "text": "Exporter"
            },
            
            "layout-button": {
                "type": "group",
                "child": {
                    "label"     : { "type":"statictext", "text": "Layout: " },
                    "button": {
                        "type": "button",
                        "text": "Export",
                        "click": function() { $.writeln("Export"); }
                    },
                }
            },
            
            "parts-button": {
                "type": "group",
                "child": {
                    "label"     : { "type":"statictext", "text": "Parts: " },
                    "button": {
                        "type": "button",
                        "text": "Export",
                        "click": function() { $.writeln("Export"); }
                    },
                }
            },
            
            "motion-button": {
                "type": "group",
                "child": {
                    "label"     : { "type":"statictext", "text": "Motion: " },
                    "button": {
                        "type": "button",
                        "text": "Export",
                        "click": function() { $.writeln("Export"); }
                    },
                }
            },
            
            "common-motion-button": {
                "type": "group",
                "child": {
                    "label"     : { "type":"statictext", "text": "Common Motion: " },
                    "button": {
                        "type": "button",
                        "text": "Export",
                        "click": function() { $.writeln("Export"); }
                    },
                }
            },
            
            "output-path": {
                "type": "group",
                "child": {
                    "label"     : { "type":"statictext", "text": "出力先: " },
                    "input" : {
                        "type"      : "edittext",
                        "text"      : "c:/",
                        "characters":20,
                        "change"     : function(e) { 
                            alert(e.target.text);
                        },
                        "shortcutKey": "s",
                        "property"  : { "name":"output-path" },
                    },
                    "iconbutton": {
                        "type"      : "iconbutton",
                        "text"      : "#FolderOpened",
                        "click"     : function(e)
                        {
                            myWindow.findElement("output-path").text = "abc";
                        }
                    }
                }
            },

        }
    };
    UI.create(myWindow, sample_data, "panel");
    myWindow.show();

    
})();

$.writeln(comment_obj.toSource());

